3.6 \(\int \frac{(d+e x) (a+b \log (c x^n))}{x^2} \, dx\)

Optimal. Leaf size=48 \[ -\frac{d \left (a+b \log \left (c x^n\right )\right )}{x}+\frac{e \left (a+b \log \left (c x^n\right )\right )^2}{2 b n}-\frac{b d n}{x} \]

[Out]

-((b*d*n)/x) - (d*(a + b*Log[c*x^n]))/x + (e*(a + b*Log[c*x^n])^2)/(2*b*n)

________________________________________________________________________________________

Rubi [A]  time = 0.0497989, antiderivative size = 43, normalized size of antiderivative = 0.9, number of steps used = 4, number of rules used = 4, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.21, Rules used = {43, 2334, 14, 2301} \[ -\left (\frac{d}{x}-e \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )-\frac{b d n}{x}-\frac{1}{2} b e n \log ^2(x) \]

Antiderivative was successfully verified.

[In]

Int[((d + e*x)*(a + b*Log[c*x^n]))/x^2,x]

[Out]

-((b*d*n)/x) - (b*e*n*Log[x]^2)/2 - (d/x - e*Log[x])*(a + b*Log[c*x^n])

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2334

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(x_)^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = I
ntHide[x^m*(d + e*x^r)^q, x]}, Simp[u*(a + b*Log[c*x^n]), x] - Dist[b*n, Int[SimplifyIntegrand[u/x, x], x], x]
] /; FreeQ[{a, b, c, d, e, n, r}, x] && IGtQ[q, 0] && IntegerQ[m] &&  !(EqQ[q, 1] && EqQ[m, -1])

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2301

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rubi steps

\begin{align*} \int \frac{(d+e x) \left (a+b \log \left (c x^n\right )\right )}{x^2} \, dx &=-\left (\frac{d}{x}-e \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )-(b n) \int \frac{-d+e x \log (x)}{x^2} \, dx\\ &=-\left (\frac{d}{x}-e \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )-(b n) \int \left (-\frac{d}{x^2}+\frac{e \log (x)}{x}\right ) \, dx\\ &=-\frac{b d n}{x}-\left (\frac{d}{x}-e \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )-(b e n) \int \frac{\log (x)}{x} \, dx\\ &=-\frac{b d n}{x}-\frac{1}{2} b e n \log ^2(x)-\left (\frac{d}{x}-e \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )\\ \end{align*}

Mathematica [A]  time = 0.0254346, size = 48, normalized size = 1. \[ -\frac{d \left (a+b \log \left (c x^n\right )\right )}{x}+\frac{e \left (a+b \log \left (c x^n\right )\right )^2}{2 b n}-\frac{b d n}{x} \]

Antiderivative was successfully verified.

[In]

Integrate[((d + e*x)*(a + b*Log[c*x^n]))/x^2,x]

[Out]

-((b*d*n)/x) - (d*(a + b*Log[c*x^n]))/x + (e*(a + b*Log[c*x^n])^2)/(2*b*n)

________________________________________________________________________________________

Maple [C]  time = 0.139, size = 250, normalized size = 5.2 \begin{align*} -{\frac{b \left ( -ex\ln \left ( x \right ) +d \right ) \ln \left ({x}^{n} \right ) }{x}}-{\frac{-i\ln \left ( x \right ) \pi \,be{\it csgn} \left ( i{x}^{n} \right ) \left ({\it csgn} \left ( ic{x}^{n} \right ) \right ) ^{2}x+i\ln \left ( x \right ) \pi \,be{\it csgn} \left ( i{x}^{n} \right ){\it csgn} \left ( ic{x}^{n} \right ){\it csgn} \left ( ic \right ) x+i\ln \left ( x \right ) \pi \,be \left ({\it csgn} \left ( ic{x}^{n} \right ) \right ) ^{3}x-i\ln \left ( x \right ) \pi \,be \left ({\it csgn} \left ( ic{x}^{n} \right ) \right ) ^{2}{\it csgn} \left ( ic \right ) x+i\pi \,bd{\it csgn} \left ( i{x}^{n} \right ) \left ({\it csgn} \left ( ic{x}^{n} \right ) \right ) ^{2}-i\pi \,bd{\it csgn} \left ( i{x}^{n} \right ){\it csgn} \left ( ic{x}^{n} \right ){\it csgn} \left ( ic \right ) -i\pi \,bd \left ({\it csgn} \left ( ic{x}^{n} \right ) \right ) ^{3}+i\pi \,bd \left ({\it csgn} \left ( ic{x}^{n} \right ) \right ) ^{2}{\it csgn} \left ( ic \right ) +enb \left ( \ln \left ( x \right ) \right ) ^{2}x-2\,\ln \left ( x \right ) \ln \left ( c \right ) bex-2\,\ln \left ( x \right ) aex+2\,\ln \left ( c \right ) bd+2\,bdn+2\,ad}{2\,x}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x+d)*(a+b*ln(c*x^n))/x^2,x)

[Out]

-b*(-e*x*ln(x)+d)/x*ln(x^n)-1/2*(-I*ln(x)*Pi*b*e*csgn(I*x^n)*csgn(I*c*x^n)^2*x+I*ln(x)*Pi*b*e*csgn(I*x^n)*csgn
(I*c*x^n)*csgn(I*c)*x+I*ln(x)*Pi*b*e*csgn(I*c*x^n)^3*x-I*ln(x)*Pi*b*e*csgn(I*c*x^n)^2*csgn(I*c)*x+I*Pi*b*d*csg
n(I*x^n)*csgn(I*c*x^n)^2-I*Pi*b*d*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)-I*Pi*b*d*csgn(I*c*x^n)^3+I*Pi*b*d*csgn(I
*c*x^n)^2*csgn(I*c)+e*n*b*ln(x)^2*x-2*ln(x)*ln(c)*b*e*x-2*ln(x)*a*e*x+2*ln(c)*b*d+2*b*d*n+2*a*d)/x

________________________________________________________________________________________

Maxima [A]  time = 1.15116, size = 66, normalized size = 1.38 \begin{align*} \frac{b e \log \left (c x^{n}\right )^{2}}{2 \, n} + a e \log \left (x\right ) - \frac{b d n}{x} - \frac{b d \log \left (c x^{n}\right )}{x} - \frac{a d}{x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))/x^2,x, algorithm="maxima")

[Out]

1/2*b*e*log(c*x^n)^2/n + a*e*log(x) - b*d*n/x - b*d*log(c*x^n)/x - a*d/x

________________________________________________________________________________________

Fricas [A]  time = 1.02131, size = 136, normalized size = 2.83 \begin{align*} \frac{b e n x \log \left (x\right )^{2} - 2 \, b d n - 2 \, b d \log \left (c\right ) - 2 \, a d + 2 \,{\left (b e x \log \left (c\right ) - b d n + a e x\right )} \log \left (x\right )}{2 \, x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))/x^2,x, algorithm="fricas")

[Out]

1/2*(b*e*n*x*log(x)^2 - 2*b*d*n - 2*b*d*log(c) - 2*a*d + 2*(b*e*x*log(c) - b*d*n + a*e*x)*log(x))/x

________________________________________________________________________________________

Sympy [A]  time = 16.6151, size = 53, normalized size = 1.1 \begin{align*} - \frac{a d}{x} + a e \log{\left (x \right )} + b d \left (- \frac{n}{x} - \frac{\log{\left (c x^{n} \right )}}{x}\right ) - b e \left (\begin{cases} - \log{\left (c \right )} \log{\left (x \right )} & \text{for}\: n = 0 \\- \frac{\log{\left (c x^{n} \right )}^{2}}{2 n} & \text{otherwise} \end{cases}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*ln(c*x**n))/x**2,x)

[Out]

-a*d/x + a*e*log(x) + b*d*(-n/x - log(c*x**n)/x) - b*e*Piecewise((-log(c)*log(x), Eq(n, 0)), (-log(c*x**n)**2/
(2*n), True))

________________________________________________________________________________________

Giac [A]  time = 1.26003, size = 76, normalized size = 1.58 \begin{align*} \frac{b n x e \log \left (x\right )^{2} + 2 \, b x e \log \left (c\right ) \log \left (x\right ) - 2 \, b d n \log \left (x\right ) + 2 \, a x e \log \left (x\right ) - 2 \, b d n - 2 \, b d \log \left (c\right ) - 2 \, a d}{2 \, x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))/x^2,x, algorithm="giac")

[Out]

1/2*(b*n*x*e*log(x)^2 + 2*b*x*e*log(c)*log(x) - 2*b*d*n*log(x) + 2*a*x*e*log(x) - 2*b*d*n - 2*b*d*log(c) - 2*a
*d)/x